﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DataAccess;
using Core;
namespace KhoaLuan.MainSys.Controls
{
    public partial class ctViewListResource : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            int orgid = int.Parse(Request.QueryString["OrgID"]);
            int typeRe = int.Parse(Request.QueryString["TypeResourcecID"]);
            object[] b = { typeRe, orgid };
            tbResourceType_Proxy proxytyperesource = new tbResourceType_Proxy();
            var resourcetype = proxytyperesource.GetById_tbResourceType_Proxy(typeRe).ToObject<tbResourceType>();

            tbResource_Proxy Proxy = new tbResource_Proxy();
            rpResource.DataSource = Proxy.GetByOrg_TypeRe_tbResource_Proxy(b);
            rpResource.DataBind();
            if (!IsPostBack)
            {
                tbOrg_Proxy intro = new tbOrg_Proxy();
                tbOrg conten = new tbOrg();
                conten = CBO.FillObject<tbOrg>(intro.GetById_tbOrg_Proxy(orgid));
                if (conten != null)
                    lbTitle.Text = resourcetype.ResourceTypeName + " - " + conten.NameOrg;
            }
        }
    }
}